package repository;


        import dbConnect.dbConnecter;
        import java.sql.ResultSet;
        import java.sql.SQLException;
        import java.sql.Statement;
        import java.sql.DriverManager;

public class CheckRepository {
    public CheckRepository(){

    }
    public boolean ChangeCheck(String check,int id)  throws SQLException {
        dbConnecter Conn = new dbConnecter();
        Conn.getConnection();
        String sql = "Update news Set Check_id=" + dbConnecter.toSql(check) + "where id=" + dbConnecter.toSqlint(id);
        try {
            int result = Conn.resultSql(sql);
            if ( result> 0) {
                return true;
            }
            else return false;
        }catch (Exception e) {
            e.printStackTrace();
            return false;
        } finally {
            Conn.close();
        }
    }
}